/**
 * @Author Stringzhua
 * @Date 2024/1/16 8:35
 * description:赋值运算符+= -=
 */
public class AssignOperator {
    public static void main(String[] args) {
        //+=
        int n1 = 10;
        n1 += 4;
        System.out.println(n1);//14
        n1 /= 3;
        System.out.println("n1 = " + n1);//n1=n1/3=14/3=4

        //复合赋值运算符会进行类型转换
        byte b = 3;
        b += 2;//b=(byte)b+2
        System.out.println("b = " + b);
    }
}
